Replication Data and Code for “Social Preferences: Measuring Private, Public and Group Preferences through Focus Groups”
Perspectives on Politics

Summer Lindsey, Assistant Professor, Rutgers University
Contact: summer.e.lindsey@rutgers.edu

Date of Posting: September 2022

Operating system used for this analysis. 
- macOS version Monterey 12.3  
- MacBook Pro. 
- Processor: Apple M1 Pro
- Memory: 16 GB 

The analyses were carried out using
 - Studio version 2022.02.0 
 - R version 4.1.3 (2022-03-10)
 - Platform: aarch64-apple-darwin20 (64-bit)

# ##############################
# Datasets posted on Dataverse:
# ##############################

Data is organized in two primary original datasets that are merged within the analysis and one tertiary dataset that is used for the Appendix only.

Data.IndividualLevel.csv:
This file includes original individual level data collected within 4 focus groups in 20 villages. There are numerical codes for each focus group and each village along with the individual-level punishment preferences for the three crimes. This file is loaded in 2.CodeVariables.R and referenced as D. See Codebook Tables 1 for description of variables.

Data.FGPunishmentRankings.csv
This file includes focus group level data focus group severity rankings of each punishment and order that each crime was presented (file loaded and referenced as D2 in 2.CodeVariables.R). See Codebook Table 2 for full variable descriptions. The order and severity rankings from this dataset are pertinent for coding the individual level preference data found within Data.IndividualLevel.csv. For this coding, Data.FGPunishmentRankings.csv is merged with Data.IndividualLevel.csv in 2.CodeVariables.R to generate D3, which is used in most analyses. See Codebook Table 3 for a description of the variables coded through the merge of the two original datasets. 

Data.VillageMatching2011.csv
This file includes data associated with the original selection of 20 village sample. This includes 10 pairs of villages matched on 2011 characteristics with half of the sample experiencing armed violence in the past 5 years and half not experiencing such an event. This is only relevant to Appendix Table A.1 and otherwise does not need to be downloaded. See Codebook Table 4 for variable descriptions.


# ##############################
# Organization of R Command Files
# ##############################

R files are designed to be run sequentially and not individually. Each file title and comments at the beginning of the file indicates the part of the analysis completed within the file.

No file can run without running the previous file. Files can be run sequentially once all R and Data Files are downloaded using 0.RunAll

1.LoadRPackages.R
2.CodeVariables.R
3.Paper_Figures.R (produces all paper figures, requires running 1-3)
4.Paper_Tables.R (produces all paper tables, requires running 1-4)
5.Appendix_Descriptives.R (produces Appendix Tables A.1-A.5, requires running 1-5)
6.Appendix_Analysis.R (produces Appendix Tables A.6-A.13, requires running 1-6)


# ##############################
# Exclusions 
# ##############################

Several pieces of information about the village sample are intentionally excluded from the files or need explanatory caveats.

Original village IDs linking each village to the original data used to calculate the pre-treatment village means used for matching are excluded. This is in accordance with IRB protocol and agreements about use of unpublished data. Cleaned and de-identified versions of the dataset used for matching are available on Harvard dataverse platforms for Tuungane 2011  data (https://doi.org/10.7910/DVN/BSASJR) and for Tuungane 2015 data (https://doi.org/10.7910/DVN/ZFAG4S). 

See Codebook for full citations of the datasets. The coding of each variable and relevant question numbers are also described in the Codebook. Deidentification of data is pursued in accordance with human subjects privacy protections (Columbia University IRB Protocols AAAQ5105 and AAAQ9306).

Please contact summer.e.lindsey@rutgers.edu with any questions or further requests.

####################################
# The following R version and packages were used:
####################################

Data From R Session using sessionInfo():

attached base packages:grid      stats     graphics  grDevices utils     datasets  methods   base     other attached packages:forcats_0.5.1    dplyr_1.0.8      purrr_0.3.4      readr_2.1.2      tidyr_1.2.0      tibble_3.1.6     
ggplot2_3.3.5    tidyverse_1.3.1  stringr_1.4.0    gridExtra_2.3    kableExtra_1.3.4 xtable_1.8-4     
stargazer_5.2.3  knitr_1.38	  Rmisc_1.5        plyr_1.8.7       lattice_0.20-45 loaded via a namespace (and not attached):Rcpp_1.0.8.3      svglite_2.1.0     lubridate_1.8.0   assertthat_0.2.1  digest_0.6.29     utf8_1.2.2        R6_2.5.1         cellranger_1.1.0  backports_1.4.1   reprex_2.0.1      evaluate_0.15     httr_1.4.2        pillar_1.7.0      rlang_1.0.2      readxl_1.4.0      rstudioapi_0.13   rmarkdown_2.14    webshot_0.5.2     munsell_0.5.0     broom_0.7.12      compiler_4.1.3   modelr_0.1.8      xfun_0.30         pkgconfig_2.0.3   systemfonts_1.0.4 htmltools_0.5.2   tidyselect_1.1.2  fansi_1.0.3      viridisLite_0.4.0 withr_2.5.0       crayon_1.5.1      tzdb_0.3.0        dbplyr_2.1.1      jsonlite_1.8.0    gtable_0.3.0     lifecycle_1.0.1   DBI_1.1.2         magrittr_2.0.2    scales_1.1.1      cli_3.2.0         stringi_1.7.6     fs_1.5.2         xml2_1.3.3        ellipsis_0.3.2    generics_0.1.2    vctrs_0.3.8       tools_4.1.3       glue_1.6.2        hms_1.1.1        fastmap_1.1.0     yaml_2.3.5        colorspace_2.0-3  rvest_1.0.2       haven_2.4.3      

